import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';
import Explore from '../views/Explore.vue';
import Exams from '../views/Exams.vue';
import FlashcardsView from '../views/FlashcardsView.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/explore',
    name: 'Explore',
    component: Explore,
  },
  {
    path: '/exams',
    name: 'Exams',
    component: Exams,
  },
    {
      path: '/flashcards/:id?',
      name: 'flashcards',
      component: FlashcardsView
    }
];

const router = createRouter({
  // 修改这一行
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;